import React, {Component} from 'react';
// import filterProps from "./hoc/hocFilterPorps";
import hocStateExtract from "./hoc/hocStateExtract";
import FormComponent from "./formComponent";

//同时拥有同一个状态
//状态 提取出来 放到高阶组件中

class HocTest1 extends Component {
  render() {
    return (
      <div>
        <h1>组件1的时间:{this.props.time}</h1>
        <button onClick={() => {
          this.props.stopTime();
        }}>停止时间
        </button>
        <button onClick={() => {
          this.props.startTime();
        }}>开始时间
        </button>

        <FormComponent />

      </div>
    );
  }
}

// HocTest1 = filterProps(HocTest1, 'red');
HocTest1 = hocStateExtract(HocTest1);
export default HocTest1;
